/*
 * 窥探对象
 */

function Mouse(id,name,age){
    this.id = id ;
    this.name = name ;
    this.age = age ;
}

Mouse.prototype.introduce = function(){
    console.log( `大家好我是${this.id}号，我叫${this.name}，今年${this.age}岁`);
}

Mouse.school = '耗子学院' ;
Mouse.show = function(){
    console.log( `这里是${Mouse.school}` ); 
}

// 把 Mouse"对象" 看作是个实例来处理
let instance = Mouse ;
// 遍历某个实例，获得属性名后再根据属性名获取属性值
for( let property in instance ){
    let value = instance[ property ];
    console.log( property );
}

console.log( '- - - - - - - - - - - - - - -' );
// 创建Mouse"对象"的实例
let x = new Mouse( 6 , '杰瑞' , 5 );
// 遍历某个实例，获得属性名后再根据属性名获取属性值
for( let p in x ){
    let v = x[ p ] ;
    console.log( p , v );
}

console.log( '- - - - - - - - - - - - - - -' );

// 获得 Mouse"对象"的原型
let prop = Mouse.prototype ;
// 将 Mouse"对象"的原型 看作是个实例来对待
// 遍历某个实例，获得属性名后再根据属性名获取属性值
for( let name in prop ){
    let value = x[ name ] ;
    console.log( name , value );
}